<?php 
	include_once 'checkloginstatus.php';
	include_once '../mysqldb/MySqlHelper.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>瑞邦晟达内容管理</title>
</head>
<body>
<a href="content.php?nid=<?php echo $_GET['nid'];?>">添加</a>
<table>
	<tr>
		<td>序号</td>
		<td>标题</td>
		<td>添加时间</td>
		<td>添加人</td>
		<td>状态</td>
		<td>修改</td>
		<td>删除</td>
		<?php 
		    if(isset($_GET['name'])){
                if($_GET['name']==='pro'){
					echo '<td>产品配图</td>';
				}
			}
		?>
	</tr>
	<?php 
		if(is_numeric($_GET['nid'])){
			$MySqlHelper = new MySqlHelper();
			$sql ='select a.ID,a.Title,a.AddTime,a.Status,b.TrueName from Content a left join ManagerList b on a.ManagerID = b.ID where a.NavID = '.$_GET['nid'];
			$rows = $MySqlHelper->GetRows($sql);
			$index=1;
			while ($row=$rows->fetch_assoc()){
	?>
	<tr>
		<td><?php echo $index;?></td>
		<td><?php echo $row['Title'];?></td>
		<td><?php echo $row['AddTime'];?></td>
		<td><?php echo $row['TrueName'];?></td>
		<td><?php echo $row['Status']?'启用':'禁用';?></td>
		<td><a href="content.php?id=<?php echo $row['ID'];?>&nid=<?php echo $_GET['nid'];?>" target="_self">修改</a></td>
		<td><a href="contentdel.php?id=<?php echo $row['ID'];?>&nid=<?php echo $_GET['nid'];?>" onclick="javascript:return window.confirm('确认要删除么？')">删除</a></td>
			<?php
				if (isset($_GET['name'])) {
					if ($_GET['name']==='pro') {
						echo '<td><a href="productimg.php?pid='.$row['ID'].'">产品配图管理</a></td>';
					}
				} 
			?>
	</tr>
	<?php 
				$index+=1;
			}
		}
	?>
</table>
</body>
</html>